//
//  config.h
//  YJB
//
//  Created by 中电大维 on 16/5/14.
//  Copyright © 2016年 YJB. All rights reserved.
//

#ifndef config_h
#define config_h

// URL
#define NEWURL(urlString) ([@"http://makegold.a8vsc.com/api/" stringByAppendingString:urlString])

//土豪URL
#define THURL(urlString) ([@"http://tuhao.a8vsc.com/tuhaoapi/" stringByAppendingString:urlString])

//广告联盟URL
#define addURL(urlString) ([@"http://adsense.a8vsc.com/api/" stringByAppendingString:urlString])

// pdo URL
#define NEWPDOURL(urlSrting) ([@"http://makegold.a8vsc.com/pdoconn/api/" stringByAppendingString:urlString])



//颜色转换 0x3298ff -> RGB
#define kUIColorFromRGB(rgbValue) [UIColor \
colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 \
green:((float)((rgbValue & 0xFF00) >> 8))/255.0 \
blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

//R G B颜色
#define MYCOLOR(R,G,B)  ([UIColor colorWithRed:(R)/255.0 green:(G)/255.0 blue:(B)/255.0 alpha:1.000])
//常用颜色
#define WHITECOLOR [UIColor whiteColor]
#define REDCOLOR [UIColor redColor]
//app主色彩 
#define APPCOLOR  kUIColorFromRGB(0xff783d)
//导航栏背景颜色
#define NAVBACKGROUNDCOLOR [UIColor whiteColor]
//导航栏标题颜色
#define NAVTITLECOLOR kUIColorFromRGB(0x333333)

//导入storyBoard中的控制器
#define loadVcFromStoryBoard(StoryBoardName,VCIdentifier) [[UIStoryboard storyboardWithName:StoryBoardName bundle:nil] instantiateViewControllerWithIdentifier:VCIdentifier];

//通知中心
#define NOTIFICATIONCENTER [NSNotificationCenter defaultCenter]

//设置图片
#define Image(iamgeNameStr)   ([UIImage imageNamed:iamgeNameStr])

// 弱引用
#define YJWeakSelf __weak typeof(self) weakSelf = self;

//屏幕宽、高
#define IPHONE_W ([UIScreen mainScreen].bounds.size.width)
#define IPHONE_H ([UIScreen mainScreen].bounds.size.height)
//水平、垂直布局格子大小均为10（5S上）,用于适配
#define GRIDW (([UIScreen mainScreen].bounds.size.width)/32)
#define GRIDH (([UIScreen mainScreen].bounds.size.height)/56)

//CGRect
#define CGRECT(x,y,w,h) CGRectMake( (x),(y),(w),(h) )
#define FONT(size) [UIFont systemFontOfSize:size]

//沙盒DOC文件夹完整路径
#define docFilePath(fileNameString) ([[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:fileNameString])
//沙盒Library中的caches完整路径（该目录下存放的是临时的缓存文件，不会被备份）
#define cachesFilePath(fileNameString) ([[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:fileNameString])
//沙盒lib文件夹完整路径
#define LIBFILEPATH(fileNameString) ([[NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:fileNameString])

//调试相关
#ifdef DEBUG
#define MyLog(FORMAT, ...) fprintf(stderr,"[%s in line %d] ==========> %s\n",[[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String]);

#else

#define MyLog(...)

#endif

#define MyLogFunc  MyLog(@"方法 ======= %s",__func__);

#endif /* config_h */



